package org.light.generator;

import java.util.ArrayList;
import java.util.List;

import org.javaforever.gatescore.utils.StringUtil;
import org.light.core.Writeable;
import org.light.domain.Statement;
import org.light.domain.Util;
import org.light.utils.WriteableUtil;

public class ExcelUtilGenerator extends Util{
	public ExcelUtilGenerator(){
		super();
		super.fileName = "ExcelUtil.go";
	}
	
	public ExcelUtilGenerator(String packageToken){
		super();
		this.setPackageToken(packageToken);
		super.fileName = "ExcelUtil.go";
	}
	
	@Override
	public void setPackageToken(String packageToken) {
		this.packageToken = packageToken;
	}
	
	public String getPackageTokenWithDot() {
		if (StringUtil.isBlank(this.getPackageToken())) return "";
		else return this.getPackageToken()+".";
	}
	
	@Override
	public String generateUtilString() {
		List<Writeable> sList = new ArrayList<Writeable>();
		long serial = 1000L;
		sList.add(new Statement(serial+1000L,0,"package utils"));
		sList.add(new Statement(serial+2000L,0,""));
		sList.add(new Statement(serial+3000L,0,"import ("));
		sList.add(new Statement(serial+4000L,1,"\"bytes\""));
		sList.add(new Statement(serial+5000L,1,"\"fmt\""));
		sList.add(new Statement(serial+6000L,1,"\"image\""));
		sList.add(new Statement(serial+7000L,1,"\"strconv\""));
		sList.add(new Statement(serial+8000L,0,""));
		sList.add(new Statement(serial+9000L,1,"_ \"image/gif\""));
		sList.add(new Statement(serial+10000L,1,"_ \"image/jpeg\""));
		sList.add(new Statement(serial+11000L,1,"_ \"image/png\""));
		sList.add(new Statement(serial+12000L,0,""));
		sList.add(new Statement(serial+13000L,1,"\"github.com/xuri/excelize/v2\""));
		sList.add(new Statement(serial+14000L,0,")"));
		sList.add(new Statement(serial+15000L,0,""));
		sList.add(new Statement(serial+16000L,0,"func ExportExcelWorkbookWithImage(sheetName string, headers []string,"));
		sList.add(new Statement(serial+17000L,1,"contents [][]interface{}, isImages []bool) *excelize.File {"));
		sList.add(new Statement(serial+18000L,0,""));
		sList.add(new Statement(serial+19000L,1,"colCount := len(isImages)"));
		sList.add(new Statement(serial+20000L,1,"rowCount := 0"));
		sList.add(new Statement(serial+21000L,1,"if (contents != nil) {"));
		sList.add(new Statement(serial+22000L,2,"rowCount = len(contents)"));
		sList.add(new Statement(serial+23000L,1,"}"));
		sList.add(new Statement(serial+24000L,0,""));
		sList.add(new Statement(serial+25000L,1,"containsImage := ContainsImage(isImages)"));
		sList.add(new Statement(serial+26000L,1,"rowHeight := 30"));
		sList.add(new Statement(serial+27000L,1,"if containsImage {"));
		sList.add(new Statement(serial+28000L,2,"rowHeight = 50"));
		sList.add(new Statement(serial+29000L,1,"}"));
		sList.add(new Statement(serial+30000L,1,"f := excelize.NewFile()"));
		sList.add(new Statement(serial+31000L,1,"f.SetDefaultFont(\"Microsoft Yahei\")"));
		sList.add(new Statement(serial+32000L,1,"// Create a new sheet."));
		sList.add(new Statement(serial+33000L,1,"index, _ := f.NewSheet(sheetName)"));
		sList.add(new Statement(serial+34000L,1,"endColName, _ := excelize.ColumnNumberToName( colCount+ 1)"));
		sList.add(new Statement(serial+35000L,0,""));
		sList.add(new Statement(serial+36000L,1,"f.SetColWidth(sheetName, \"B\", endColName, 16)"));
		sList.add(new Statement(serial+37000L,1,"f.SetRowHeight(sheetName, 2, 30)"));
		sList.add(new Statement(serial+38000L,1,"f.SetSheetRow(sheetName, \"B2\", &headers)"));
		sList.add(new Statement(serial+39000L,1,"_ = f.SetCellStyle(sheetName, \"B3\", endColName+strconv.FormatInt(int64(rowCount+2), 10), bodyStyle(f))"));
		sList.add(new Statement(serial+40000L,1,"if (rowCount == 0){"));
		sList.add(new Statement(serial+41000L,2,"f.SetRowHeight(sheetName, 3, 30)"));
		sList.add(new Statement(serial+42000L,2,"for j := 0; j < colCount; j++ {"));
		sList.add(new Statement(serial+43000L,3,"currentColName, _ := excelize.ColumnNumberToName(j + 2)"));
		sList.add(new Statement(serial+44000L,3,"f.SetCellStr(sheetName, currentColName+strconv.FormatInt(int64(3), 10), \"\")"));
		sList.add(new Statement(serial+45000L,2,"}"));
		sList.add(new Statement(serial+46000L,1,"}"));
		sList.add(new Statement(serial+47000L,1,"for i := 0; i < rowCount; i++ {"));
		sList.add(new Statement(serial+48000L,2,"f.SetRowHeight(sheetName, i+3, float64(rowHeight))"));
		sList.add(new Statement(serial+49000L,2,"for j := 0; j < colCount; j++ {"));
		sList.add(new Statement(serial+50000L,3,"currentColName, _ := excelize.ColumnNumberToName(j + 2)"));
		sList.add(new Statement(serial+51000L,3,"if isImages[j] == true {"));
		sList.add(new Statement(serial+52000L,4,"raw := contents[i][j].([]byte)"));
		sList.add(new Statement(serial+53000L,4,"if raw != nil {"));
		sList.add(new Statement(serial+54000L,5,"c, _, _ := image.DecodeConfig(bytes.NewReader(raw))"));
		sList.add(new Statement(serial+55000L,5,"ratio := float64(70) / float64(c.Height)"));
		sList.add(new Statement(serial+56000L,5,"offsetx := int((float64(130) - float64(c.Width)*ratio) / float64(2))"));
		sList.add(new Statement(serial+57000L,5,"fmt.Println(ratio)"));
		sList.add(new Statement(serial+58000L,5,"if err := f.AddPictureFromBytes(sheetName, currentColName+strconv.FormatInt(int64(i+3), 10), 				&excelize.Picture{"));
		sList.add(new Statement(serial+59000L,6,"Extension: \".jpg\","));
		sList.add(new Statement(serial+60000L,6,"File:      raw,"));
		sList.add(new Statement(serial+61000L,6,"Format:    &excelize.GraphicOptions{"));
		sList.add(new Statement(serial+62000L,7,"OffsetX:	offsetx,"));
		sList.add(new Statement(serial+63000L,7,"OffsetY:		0.0,"));
		sList.add(new Statement(serial+64000L,7,"ScaleX:        ratio,"));
		sList.add(new Statement(serial+65000L,7,"ScaleY:        ratio,"));
		sList.add(new Statement(serial+66000L,6,"},"));
		sList.add(new Statement(serial+66100L,6,"}); err != nil {"));
		sList.add(new Statement(serial+66200L,6,"fmt.Println(err)"));
		sList.add(new Statement(serial+66300L,6,"}"));
		sList.add(new Statement(serial+66400L,4,"}"));
		sList.add(new Statement(serial+67000L,3,"} else {"));
		sList.add(new Statement(serial+68000L,4,"f.SetCellStr(sheetName, currentColName+strconv.FormatInt(int64(i+3), 10), contents[i][j].(string))"));
		sList.add(new Statement(serial+69000L,3,"}"));
		sList.add(new Statement(serial+70000L,2,"}"));
		sList.add(new Statement(serial+71000L,1,"}"));
		sList.add(new Statement(serial+72000L,1,""));
		sList.add(new Statement(serial+73000L,1,"outputRowEnd := rowCount+2"));
		sList.add(new Statement(serial+74000L,1,"if rowCount == 0 {"));
		sList.add(new Statement(serial+75000L,2,"outputRowEnd = 3"));
		sList.add(new Statement(serial+76000L,1,"}"));
		sList.add(new Statement(serial+77000L,1,""));
		sList.add(new Statement(serial+78000L,1,"outBoxStyle(f, sheetName, \"B\", endColName, 2, outputRowEnd)"));
		sList.add(new Statement(serial+79000L,1,"// Set active sheet of the workbook."));
		sList.add(new Statement(serial+80000L,1,"f.SetActiveSheet(index)"));
		sList.add(new Statement(serial+81000L,1,"return f"));
		sList.add(new Statement(serial+82000L,0,"}"));
		sList.add(new Statement(serial+83000L,0,""));
		sList.add(new Statement(serial+84000L,0,"func ContainsImage(isImages []bool) bool {"));
		sList.add(new Statement(serial+85000L,1,"for _, isImage := range isImages {"));
		sList.add(new Statement(serial+86000L,2,"if isImage {"));
		sList.add(new Statement(serial+87000L,3,"return true"));
		sList.add(new Statement(serial+88000L,2,"}"));
		sList.add(new Statement(serial+89000L,1,"}"));
		sList.add(new Statement(serial+90000L,1,"return false"));
		sList.add(new Statement(serial+91000L,0,"}"));
		sList.add(new Statement(serial+92000L,0,""));
		sList.add(new Statement(serial+93000L,0,"func headStyle(f *excelize.File) int {"));
		sList.add(new Statement(serial+94000L,1,"style, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+95000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+96000L,2,"{"));
		sList.add(new Statement(serial+97000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+98000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+99000L,3,"Style: 1,"));
		sList.add(new Statement(serial+100000L,2,"},"));
		sList.add(new Statement(serial+101000L,2,"{"));
		sList.add(new Statement(serial+102000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+103000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+104000L,3,"Style: 1,"));
		sList.add(new Statement(serial+105000L,2,"},"));
		sList.add(new Statement(serial+106000L,2,"{"));
		sList.add(new Statement(serial+107000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+108000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+109000L,3,"Style:1,"));
		sList.add(new Statement(serial+110000L,2,"},"));
		sList.add(new Statement(serial+111000L,2,"{"));
		sList.add(new Statement(serial+112000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+113000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+114000L,3,"Style: 1,"));
		sList.add(new Statement(serial+115000L,2,"},"));
		sList.add(new Statement(serial+116000L,2,"},"));
		sList.add(new Statement(serial+117000L,2,"Fill:excelize.Fill{"));
		sList.add(new Statement(serial+118000L,3,"Type:\"pattern\","));
		sList.add(new Statement(serial+119000L,3,"Color:[] string{\"#FFFF00\"},"));
		sList.add(new Statement(serial+120000L,3,"Pattern:1,"));
		sList.add(new Statement(serial+121000L,2,"},"));
		sList.add(new Statement(serial+122000L,2,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+123000L,3,"Bold: true,"));
		sList.add(new Statement(serial+124000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+125000L,2,"},"));
		sList.add(new Statement(serial+126000L,2,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+127000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+128000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+129000L,2,"},"));
		sList.add(new Statement(serial+130000L,1,"})"));
		sList.add(new Statement(serial+131000L,1,"if err != nil {"));
		sList.add(new Statement(serial+132000L,2,"fmt.Println(err)"));
		sList.add(new Statement(serial+133000L,1,"}"));
		sList.add(new Statement(serial+134000L,1,"return style"));
		sList.add(new Statement(serial+135000L,0,"}"));
		sList.add(new Statement(serial+136000L,0,""));
		sList.add(new Statement(serial+137000L,0,"func bodyStyle(f *excelize.File) int {"));
		sList.add(new Statement(serial+138000L,1,"style, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+139000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+140000L,2,"{"));
		sList.add(new Statement(serial+141000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+142000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+143000L,3,"Style: 1,"));
		sList.add(new Statement(serial+144000L,2,"},"));
		sList.add(new Statement(serial+145000L,2,"{"));
		sList.add(new Statement(serial+146000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+147000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+148000L,3,"Style: 1,"));
		sList.add(new Statement(serial+149000L,2,"},"));
		sList.add(new Statement(serial+150000L,2,"{"));
		sList.add(new Statement(serial+151000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+152000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+153000L,3,"Style:1,"));
		sList.add(new Statement(serial+154000L,2,"},"));
		sList.add(new Statement(serial+155000L,2,"{"));
		sList.add(new Statement(serial+156000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+157000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+158000L,3,"Style: 1,"));
		sList.add(new Statement(serial+159000L,2,"},"));
		sList.add(new Statement(serial+160000L,1,"},"));
		sList.add(new Statement(serial+161000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+162000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+163000L,2,"},"));
		sList.add(new Statement(serial+164000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+165000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+166000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+167000L,2,"},"));
		sList.add(new Statement(serial+168000L,1,"})"));
		sList.add(new Statement(serial+169000L,1,"if err != nil {"));
		sList.add(new Statement(serial+170000L,2,"fmt.Println(err)"));
		sList.add(new Statement(serial+171000L,1,"}"));
		sList.add(new Statement(serial+172000L,1,"return style"));
		sList.add(new Statement(serial+173000L,0,"}"));
		sList.add(new Statement(serial+174000L,0,""));
		sList.add(new Statement(serial+175000L,0,"func outBoxStyle(f *excelize.File, sheetName string, colBegin string, colEnd string, rowBegin int, rowEnd int) {"));
		sList.add(new Statement(serial+176000L,1,"styleleft, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+177000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+178000L,2,"{"));
		sList.add(new Statement(serial+179000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+180000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+181000L,3,"Style: 2,"));
		sList.add(new Statement(serial+182000L,2,"},"));
		sList.add(new Statement(serial+183000L,2,"{"));
		sList.add(new Statement(serial+184000L,3,"Type:  \"top\","));
		sList.add(new Statement(serial+185000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+186000L,3,"Style:1,"));
		sList.add(new Statement(serial+187000L,2,"},"));
		sList.add(new Statement(serial+188000L,2,"{"));
		sList.add(new Statement(serial+189000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+190000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+191000L,3,"Style:1,"));
		sList.add(new Statement(serial+192000L,2,"},"));
		sList.add(new Statement(serial+193000L,2,"{"));
		sList.add(new Statement(serial+194000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+195000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+196000L,3,"Style: 1,"));
		sList.add(new Statement(serial+197000L,2,"},"));
		sList.add(new Statement(serial+198000L,2,"},"));
		sList.add(new Statement(serial+199000L,2,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+200000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+201000L,2,"},"));
		sList.add(new Statement(serial+202000L,2,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+203000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+204000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+205000L,2,"},"));
		sList.add(new Statement(serial+206000L,1,"})"));
		sList.add(new Statement(serial+207000L,1,"styleright, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+208000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+209000L,2,"{"));
		sList.add(new Statement(serial+210000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+211000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+212000L,3,"Style:2,"));
		sList.add(new Statement(serial+213000L,2,"},"));
		sList.add(new Statement(serial+214000L,2,"{"));
		sList.add(new Statement(serial+215000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+216000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+217000L,3,"Style: 1,"));
		sList.add(new Statement(serial+218000L,2,"},"));
		sList.add(new Statement(serial+219000L,2,"{"));
		sList.add(new Statement(serial+220000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+221000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+222000L,3,"Style: 1,"));
		sList.add(new Statement(serial+223000L,2,"},"));
		sList.add(new Statement(serial+224000L,2,"{"));
		sList.add(new Statement(serial+225000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+226000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+227000L,3,"Style:1,"));
		sList.add(new Statement(serial+228000L,2,"},"));
		sList.add(new Statement(serial+229000L,1,"},"));
		sList.add(new Statement(serial+230000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+231000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+232000L,2,"},"));
		sList.add(new Statement(serial+233000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+234000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+235000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+236000L,2,"},"));
		sList.add(new Statement(serial+237000L,1,"})"));
		sList.add(new Statement(serial+238000L,1,"styletop, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+239000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+240000L,2,"{"));
		sList.add(new Statement(serial+241000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+242000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+243000L,3,"Style:2,"));
		sList.add(new Statement(serial+244000L,2,"},"));
		sList.add(new Statement(serial+245000L,2,"{"));
		sList.add(new Statement(serial+246000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+247000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+248000L,3,"Style: 1,"));
		sList.add(new Statement(serial+249000L,2,"},"));
		sList.add(new Statement(serial+250000L,2,"{"));
		sList.add(new Statement(serial+251000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+252000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+253000L,3,"Style:1,"));
		sList.add(new Statement(serial+254000L,2,"},"));
		sList.add(new Statement(serial+255000L,2,"{"));
		sList.add(new Statement(serial+256000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+257000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+258000L,3,"Style: 1,"));
		sList.add(new Statement(serial+259000L,2,"},"));
		sList.add(new Statement(serial+260000L,1,"},"));
		sList.add(new Statement(serial+261000L,1,"Fill:excelize.Fill{"));
		sList.add(new Statement(serial+262000L,3,"Type:\"pattern\","));
		sList.add(new Statement(serial+263000L,3,"Color:[] string{\"#FFFF00\"},"));
		sList.add(new Statement(serial+264000L,3,"Pattern:1,"));
		sList.add(new Statement(serial+265000L,2,"},"));
		sList.add(new Statement(serial+266000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+267000L,3,"Bold: true,"));
		sList.add(new Statement(serial+268000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+269000L,2,"},"));
		sList.add(new Statement(serial+270000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+271000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+272000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+273000L,2,"},"));
		sList.add(new Statement(serial+274000L,1,"})"));
		sList.add(new Statement(serial+275000L,1,"stylebottom, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+276000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+277000L,2,"{"));
		sList.add(new Statement(serial+278000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+279000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+280000L,3,"Style:2,"));
		sList.add(new Statement(serial+281000L,2,"},"));
		sList.add(new Statement(serial+282000L,2,"{"));
		sList.add(new Statement(serial+283000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+284000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+285000L,3,"Style: 1,"));
		sList.add(new Statement(serial+286000L,2,"},"));
		sList.add(new Statement(serial+287000L,2,"{"));
		sList.add(new Statement(serial+288000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+289000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+290000L,3,"Style: 1,"));
		sList.add(new Statement(serial+291000L,2,"},"));
		sList.add(new Statement(serial+292000L,2,"{"));
		sList.add(new Statement(serial+293000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+294000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+295000L,3,"Style: 1,"));
		sList.add(new Statement(serial+296000L,2,"},"));
		sList.add(new Statement(serial+297000L,1,"},"));
		sList.add(new Statement(serial+298000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+299000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+300000L,2,"},"));
		sList.add(new Statement(serial+301000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+302000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+303000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+304000L,2,"},"));
		sList.add(new Statement(serial+305000L,1,"})"));
		sList.add(new Statement(serial+306000L,0,""));
		sList.add(new Statement(serial+307000L,1,"styleTopLeft, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+308000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+309000L,2,"{"));
		sList.add(new Statement(serial+310000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+311000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+312000L,3,"Style:2,"));
		sList.add(new Statement(serial+313000L,2,"},"));
		sList.add(new Statement(serial+314000L,2,"{"));
		sList.add(new Statement(serial+315000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+316000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+317000L,3,"Style: 2,"));
		sList.add(new Statement(serial+318000L,2,"},"));
		sList.add(new Statement(serial+319000L,2,"{"));
		sList.add(new Statement(serial+320000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+321000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+322000L,3,"Style:1,"));
		sList.add(new Statement(serial+323000L,2,"},"));
		sList.add(new Statement(serial+324000L,2,"{"));
		sList.add(new Statement(serial+325000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+326000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+327000L,3,"Style: 1,"));
		sList.add(new Statement(serial+328000L,2,"},"));
		sList.add(new Statement(serial+329000L,1,"},"));
		sList.add(new Statement(serial+330000L,1,"Fill:excelize.Fill{"));
		sList.add(new Statement(serial+331000L,3,"Type:\"pattern\","));
		sList.add(new Statement(serial+332000L,3,"Color:[] string{\"#FFFF00\"},"));
		sList.add(new Statement(serial+333000L,3,"Pattern:1,"));
		sList.add(new Statement(serial+334000L,2,"},"));
		sList.add(new Statement(serial+335000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+336000L,3,"Bold: true,"));
		sList.add(new Statement(serial+337000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+338000L,2,"},"));
		sList.add(new Statement(serial+339000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+340000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+341000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+342000L,2,"},"));
		sList.add(new Statement(serial+343000L,1,"})"));
		sList.add(new Statement(serial+344000L,0,""));
		sList.add(new Statement(serial+345000L,1,"styleTopRight, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+346000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+347000L,2,"{"));
		sList.add(new Statement(serial+348000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+349000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+350000L,3,"Style:2,"));
		sList.add(new Statement(serial+351000L,2,"},"));
		sList.add(new Statement(serial+352000L,2,"{"));
		sList.add(new Statement(serial+353000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+354000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+355000L,3,"Style: 1,"));
		sList.add(new Statement(serial+356000L,2,"},"));
		sList.add(new Statement(serial+357000L,2,"{"));
		sList.add(new Statement(serial+358000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+359000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+360000L,3,"Style:1,"));
		sList.add(new Statement(serial+361000L,2,"},"));
		sList.add(new Statement(serial+362000L,2,"{"));
		sList.add(new Statement(serial+363000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+364000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+365000L,3,"Style: 2,"));
		sList.add(new Statement(serial+366000L,2,"},"));
		sList.add(new Statement(serial+367000L,1,"},"));
		sList.add(new Statement(serial+368000L,1,"Fill:excelize.Fill{"));
		sList.add(new Statement(serial+369000L,3,"Type:\"pattern\","));
		sList.add(new Statement(serial+370000L,3,"Color:[] string{\"#FFFF00\"},"));
		sList.add(new Statement(serial+371000L,3,"Pattern:1,"));
		sList.add(new Statement(serial+372000L,2,"},"));
		sList.add(new Statement(serial+373000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+374000L,3,"Bold: true,"));
		sList.add(new Statement(serial+375000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+376000L,2,"},"));
		sList.add(new Statement(serial+377000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+378000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+379000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+380000L,2,"},"));
		sList.add(new Statement(serial+381000L,1,"})"));
		sList.add(new Statement(serial+382000L,0,""));
		sList.add(new Statement(serial+383000L,1,"styleBottomLeft, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+384000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+385000L,2,"{"));
		sList.add(new Statement(serial+386000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+387000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+388000L,3,"Style:2,"));
		sList.add(new Statement(serial+389000L,2,"},"));
		sList.add(new Statement(serial+390000L,2,"{"));
		sList.add(new Statement(serial+391000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+392000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+393000L,3,"Style: 2,"));
		sList.add(new Statement(serial+394000L,2,"},"));
		sList.add(new Statement(serial+395000L,2,"{"));
		sList.add(new Statement(serial+396000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+397000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+398000L,3,"Style: 1,"));
		sList.add(new Statement(serial+399000L,2,"},"));
		sList.add(new Statement(serial+400000L,2,"{"));
		sList.add(new Statement(serial+401000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+402000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+403000L,3,"Style: 1,"));
		sList.add(new Statement(serial+404000L,2,"},"));
		sList.add(new Statement(serial+405000L,1,"},"));
		sList.add(new Statement(serial+406000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+407000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+408000L,2,"},"));
		sList.add(new Statement(serial+409000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+410000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+411000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+412000L,2,"},"));
		sList.add(new Statement(serial+413000L,1,"})"));
		sList.add(new Statement(serial+414000L,0,""));
		sList.add(new Statement(serial+415000L,1,"styleBottomRight, err := f.NewStyle(&excelize.Style{"));
		sList.add(new Statement(serial+416000L,2,"Border: []excelize.Border{"));
		sList.add(new Statement(serial+417000L,2,"{"));
		sList.add(new Statement(serial+418000L,3,"Type: \"bottom\","));
		sList.add(new Statement(serial+419000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+420000L,3,"Style:2,"));
		sList.add(new Statement(serial+421000L,2,"},"));
		sList.add(new Statement(serial+422000L,2,"{"));
		sList.add(new Statement(serial+423000L,3,"Type: \"left\","));
		sList.add(new Statement(serial+424000L,3,"Color: \"000000\","));
		sList.add(new Statement(serial+425000L,3,"Style: 1,"));
		sList.add(new Statement(serial+426000L,2,"},"));
		sList.add(new Statement(serial+427000L,2,"{"));
		sList.add(new Statement(serial+428000L,3,"Type: \"top\","));
		sList.add(new Statement(serial+429000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+430000L,3,"Style: 1,"));
		sList.add(new Statement(serial+431000L,2,"},"));
		sList.add(new Statement(serial+432000L,2,"{"));
		sList.add(new Statement(serial+433000L,3,"Type: \"right\","));
		sList.add(new Statement(serial+434000L,3,"Color:\"000000\","));
		sList.add(new Statement(serial+435000L,3,"Style: 2,"));
		sList.add(new Statement(serial+436000L,2,"},"));
		sList.add(new Statement(serial+437000L,1,"},"));
		sList.add(new Statement(serial+438000L,1,"Font: &excelize.Font{"));
		sList.add(new Statement(serial+439000L,3,"Family: \"Microsoft Yahei\","));
		sList.add(new Statement(serial+440000L,2,"},"));
		sList.add(new Statement(serial+441000L,1,"Alignment: &excelize.Alignment{"));
		sList.add(new Statement(serial+442000L,3,"Horizontal: \"center\","));
		sList.add(new Statement(serial+443000L,3,"Vertical: \"center\","));
		sList.add(new Statement(serial+444000L,2,"},"));
		sList.add(new Statement(serial+445000L,1,"})"));
		sList.add(new Statement(serial+446000L,0,""));
		sList.add(new Statement(serial+447000L,1,"if err != nil {"));
		sList.add(new Statement(serial+448000L,2,"fmt.Println(err)"));
		sList.add(new Statement(serial+449000L,1,"}"));
		sList.add(new Statement(serial+450000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowBegin), 10), colEnd+strconv.FormatInt(int64(rowBegin), 10), styletop)"));
		sList.add(new Statement(serial+451000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowEnd), 10), colEnd+strconv.FormatInt(int64(rowEnd), 10), stylebottom)"));
		sList.add(new Statement(serial+452000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowBegin), 10), colBegin+strconv.FormatInt(int64(rowEnd), 10), styleleft)"));
		sList.add(new Statement(serial+453000L,1,"_ = f.SetCellStyle(sheetName, colEnd+strconv.FormatInt(int64(rowBegin), 10), colEnd+strconv.FormatInt(int64(rowEnd), 10), styleright)"));
		sList.add(new Statement(serial+454000L,0,""));
		sList.add(new Statement(serial+455000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowBegin), 10), colBegin+strconv.FormatInt(int64(rowBegin), 10), styleTopLeft)"));
		sList.add(new Statement(serial+456000L,1,"_ = f.SetCellStyle(sheetName, colEnd+strconv.FormatInt(int64(rowBegin), 10), colEnd+strconv.FormatInt(int64(rowBegin), 10), styleTopRight)"));
		sList.add(new Statement(serial+457000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowEnd), 10), colBegin+strconv.FormatInt(int64(rowEnd), 10), styleBottomLeft)"));
		sList.add(new Statement(serial+458000L,1,"_ = f.SetCellStyle(sheetName, colEnd+strconv.FormatInt(int64(rowEnd), 10), colEnd+strconv.FormatInt(int64(rowEnd), 10), styleBottomRight)"));
		sList.add(new Statement(serial+459000L,1,"err = nil"));
		sList.add(new Statement(serial+460000L,0,"}"));
		
		return WriteableUtil.merge(sList).getContent();
	}

}
